/**============================================================================
 Confidential Information - Limited distribution to authorized persons only.
 This software is protected as an unpublished work under the U.S. Copyright
 Act of 1976.

 Copyright (c) 2011, BluePhoenix Solutions, Inc. All rights reserved.
 ----------------------------------------------------------------------------
 file......: CoreUtils.java
 Author....: Vyacheslav Kovalyov
 Created...: 22.10.11

 Description:

 ============================================================================*/
package ru.monyag.pred.core.utils;

import java.text.MessageFormat;
import java.util.ResourceBundle;

import static java.util.ResourceBundle.getBundle;
import static ru.monyag.pred.core.utils.PredCoreConstants.BUNDLE_NAME;

/**
 * @author Vyacheslav Kovalyov
 * @version 1.0
 */
public abstract class PredCoreUtils {

    public static String getString(String key, Object... params) {
        String value = resourceBundle.getString(key);

        if (params.length == 0) {
            return value;
        } else {
            return MessageFormat.format(value, params);
        }
    }

    private final static ResourceBundle resourceBundle = getBundle(BUNDLE_NAME);
}
